{% extends "base.html" %}
{% load i18n %}
{% block head %}
<title>{% trans '图片资源 | 蓝鲸开发框架' %}</title>
{{ block.super }}
{% endblock %}

{% block content %}
<div>
    <!--    图片上传 -->
    <div id="up-image" style="height: 100px; width: 300px">
        <form method="post" enctype="multipart/form-data" action="upload/">
            {% csrf_token %}
            <input type="file" id="exampleInputFile" name="pics" accept="image/png,image/gif,image/jpeg">
            <button style="float: right;margin-top: 22px;" type="submit" class="btn btn-primary btn-lg">Submit</button>
        </form>
    </div>
    <!--    图片展示 -->
    <div id="images">
        {% for image in image_list %}
        <div style="display: inline-block">
            <div style="width: 50%">
                <img src="{{ image.image_url }}" alt="{{ image.image_id }}" style="width: 10%;height: 10%">
                <a href="{% url 'doc:download' image.image_id %}">下载该图片</a>
            </div>
            <hr>
        </div>
        {% endfor %}
    </div>
</div>
{% endblock %}
